import request from '@/config/axios'

export type ProjectVO = {
  id: string,
  projectName: string,//项目名称
  partyA: number,//甲方单位
  liaison: number,//对接人
  director: number,//负责人
  members: number[],//成员
  producer: number,//制作人
  content: string,
  startDate: Date,
  endDate: Date,
  submissionDate: Date,//预估交稿时间
  projectStatus: number,//项目进度
  projectLevel: number,//项目等级
  taskStatus: string,//任务进度
  remake: string,//任务进度
}

export const getProjectPage = (params: PageParam): Promise<{
  total: number,
  list: ProjectVO[]
}> => request.get({
  url: '/business/project/page',
  params
})
export const getProject = (id: number): Promise<ProjectVO> => request.get({
  url: `/business/project/${id}`
})

export const delProjectList = (ids: number[]): Promise<ProjectVO> => request.get({
  url: `/business/project/delete`,
  params: {ids: ids.join(',')}
})
export const createProject = (data: ProjectVO) => request.post({
  url: `/business/project/create`,
  data
})
export const updateProject = (data: ProjectVO) => request.post({
  url: `/business/project/update`,
  data
})

